#include<iostream>
#include<unistd.h>
#include<vector>
#include"Thread.hpp"

using namespace std;

void Print(){
    while(true){
        printf("haha,我是一个封装的线程...\n");
        sleep(1);
    }
}

int main(){
    std::vector<Thread> threads;//线程数组

    for(int i=0;i<10;i++){
        threads.push_back(Thread(Print));
    }
    
    for(auto &t:threads){
        t.Run();
    }
    
    for(auto &t:threads){//依次等待
        t.Join();
    }
    
    return 0;
}